package com.esd.csair;

import java.io.Serializable;

import net.sf.json.JSON;
import net.sf.json.JSONObject;
import net.sf.json.xml.XMLSerializer;


public class XmlExercise implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 8320005551311749088L;

	/**
	 * 将xml字符串<STRONG>转换</STRONG>为JSON字符串
	 * 
	 * @param xmlString
	 *            xml字符串
	 * @return JSON<STRONG>对象</STRONG>
	 */
	public static JSONObject xml2json(String xmlString) {
		XMLSerializer xmlSerializer = new XMLSerializer();
		JSON json = xmlSerializer.read(xmlString);
		JSONObject jsonObject=JSONObject.fromObject(json);
		return jsonObject;
	}



}
